<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'deliveryReport.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
	<link rel="stylesheet" href="${staticPath }/static/bootstrap/bootstrap.min.css" />

	<!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
	<link rel="stylesheet" href="${staticPath }/static/bootstrap/bootstrap-theme.min.css" />
  </head>  
  <body>
    <div style="margin-top:10px;text-align: right;">
		<a href="/haierp1/bi/ship/selectBiPackerReportByPackageTime" style="padding-left:5px;"><input type="button" value="切换到打包人报表"/></a>	
	</div>
	<div style="width:350px;  margin: 0 auto;margin-top:75px; float:left; margin-left: 10px"   >
  		<table class="table table-bordered">
  			<tr class="info">
  				<td>发货月份</td>
  				<td>合计商品数</td>	
  			</tr>
				<c:forEach items="${shipMonth}" var="purchase">
		 		<tr >
		    	<td>${purchase.dimensionDate}</td>
		    	<td>${purchase.deliverItemNum}</td>
		  		</tr>
			</c:forEach>
		</table>
	</div>
    <div style="width:750px;  margin: 0 auto;margin-top:75px; float:left; margin-left: 10px"   >
  		<table class="table table-bordered">
  			<tr class="info">
  				<td>发货时间</td>
  				<td>商品总量</td>
  				<td>包裹总量</td>
  				<td>发货人</td>
  				<td>物流公司</td>
  				<td>商品数量</td>
  				<td>包裹数量</td>
  			</tr>

  			<c:set var="tjNum" value="1"  />
  			<c:set var="tjNumByName" value="1"  />
			<c:forEach items="${shipDeliveryList}" var="shipDelivery" varStatus="status">
			<c:set var="nameCountTemp" value="${shipDelivery.dimensionDate}${shipDelivery.deliverPerson}"/>  
		 		<tr>
		 			<c:if test="${tjNum == 1}">
			    	<td rowspan=${shipMap[shipDelivery.dimensionDate].count} style="text-align:center;vertical-align:middle">${shipDelivery.dimensionDate}</td>
			    	</c:if>
			    	<c:if test="${tjNumByName == 1}">
			    	<td rowspan=${shipMapByName[nameCountTemp].nameCount} style="text-align:center;vertical-align:middle">${shipMapByName[nameCountTemp].deliverItemNumTotal}</td>
			    	<td rowspan=${shipMapByName[nameCountTemp].nameCount} style="text-align:center;vertical-align:middle">${shipMapByName[nameCountTemp].deliverPkgNumTotal}</td>
			    	<td rowspan=${shipMapByName[nameCountTemp].nameCount} style="text-align:center;vertical-align:middle">${shipDelivery.deliverPerson}</td>
			    	</c:if>
			    	<td>${shipDelivery.logisticCompany}</td>
			    	<td>${shipDelivery.deliverItemNum}</td>
			    	<td>${shipDelivery.deliverPkgNum}</td>
		  		</tr>
		  		<c:if test="${tjNumByName == shipMapByName[nameCountTemp].nameCount}">
		  			<c:set var="tjNumByName" value="0"  />
		  		</c:if>
		  		<c:set var="tjNumByName" value="${tjNumByName+1}"  />
		  		<c:if test="${tjNum == shipMap[shipDelivery.dimensionDate].count}">
		  			<c:set var="tjNum" value="0"  />
		  		</c:if>
		  		<c:set var="tjNum" value="${tjNum+1}"  />
			</c:forEach>
		</table>
	</div>
  </body>
</html>
